<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
    <th:block th:include="include :: header('统计分析')" />
</head>
<body class="gray-bg">
     <div class="container-div">
        <div class="row">
            <div class="col-sm-12 search-collapse">
                <form id="formId">
                    <div class="select-list">
                        <ul>
                            <li class="select-time">
                                <p>日期：</p>
                                <input type="text" autocomplete="off" class="time-input" id="beginTime" placeholder="开始时间" name="params[beginTime]"/>
                                <span>-</span>
                                <input type="text" autocomplete="off" class="time-input" id="endTime" placeholder="结束时间" name="params[endTime]"/>
                            </li>
                            <li>
                                <p>创建人：</p>
                                <select id="userId" name="userId">

                                </select>
                            </li>
                            <li>
                                <a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>
                                <a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i>&nbsp;重置</a>
                            </li>
                        </ul>
                    </div>
                </form>
            </div>


            <div class="col-sm-12 select-table table-striped">
                <table id="bootstrap-table"></table>
            </div>
        </div>
    </div>
    <th:block th:include="include :: footer" />
    <script th:inline="javascript">
        var prefix = ctx + "system/agent";

        $(function() {
            $.get(prefix + "/getSysUserList", function(data) {
                //console.log(data);
                var str = '<option value="">所有</option>';
                for(var i=0;i<data.length;i++){
                    str += '<option value="'+data[i].userId+'">'+data[i].userName+'</option>';
                }
                $('#userId').html(str);
            });
            var options = {
                url: prefix + "/analysizeList",
                modalName: "中介",
                columns: [
                {
                    field : 'userName',
                    title : '创建人'
                },
                {
                    field : 'date',
                    title : '创建时间'
                },
                {
                    field : 'num',
                    title : '录入客户'
                },
                {
                    field : 'rnum',
                    title : '跟踪客户'
                }]
            };
            $.table.init(options);
        });
    </script>
</body>
</html>